package com.chuyangc.controller;

import com.chuyangc.entity.User;
import com.chuyangc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 欧楚杨
 */
@RestController
@RequestMapping("user")
public class UserController {
    private final UserService userService;

    UserController(UserService userService){
        this.userService = userService;
    }

    @GetMapping("/selectAll")
    public List<User> selectAll(){
        return userService.list();
    }
}
